﻿#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
#endregion  

namespace Ramparts
{
    public class WorldHelper
    {

        World world;

        public WorldHelper(World world)
        {
            this.world = world;
        }

        // Land Based Move
        public Vector2 attemptMove(int currentPositionX, int currentPositionY, int xChange, int yChange)
        {
            if (world.groundLayer.getGridValueByCoordinates(currentPositionX + xChange, currentPositionY + yChange) != 1)
            {
                return new Vector2(currentPositionY + xChange, currentPositionY + yChange);
            }
            else
            {
                return new Vector2((float)currentPositionX, ((float)currentPositionY));
            }
        }

    }
}
